<script lang="ts" name="list" setup>
import { useKeepAliveStore } from '@/stores'
import { comeBack, generateRouteRecordRaw } from '@/utils'

const keepAliveStore = useKeepAliveStore()
const route = useRoute()
function cancelBack() {
  keepAliveStore.removeView(generateRouteRecordRaw(route))
  comeBack()
}
</script>

<template>
  <div>
    列表
    <div>
      <input placeholder="请输入内容" />
      <button class="bg-amber-400 px-0.5 py-0.5 border-[10px]" @click="comeBack()">返回上一页</button>
      <button class="bg-amber-400 ml-2 px-0.5 py-0.5 border-[10px]" @click="cancelBack">删除缓存返回上一页</button>
    </div>
  </div>
</template>
